<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
<!-- 第一步先计算高度，假设宽100%，那么高为h=9/16=56.25%
  第二步利用之前所说设置padding-bottom方法实现矩形 -->
    <div class="box">
        <div class="scale">
            <p class="item">这是一个16:9的矩形</p>
        </div>
    </div>
</body>
<style>
    .box {
    width: 100%;
    }

    .scale {
    height: 56.25vw;
    position: relative;

    }

    .item {
    width: 100%;
    height: 100%;
    background-color: pink;
    position: absolute;
    }
</style>
</html>